<!DOCTYPE HTML>
<html>
<head>
<?php
	include("components/helper.php");
	include("components/metadata.php");
?>
<title>40Towers - Episode Guide</title>
<link rel="stylesheet" href="css/global.css" />
<link rel="stylesheet" href="css/episode_guide.css" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php
	include("components/analytics.php");
	include("components/database.php");	
?>
</head>
<body>

<div id="page">
    <?php
		include("components/header.php");
		include("components/nav.php");
	?>
    
    <div>
    <section class="group">
        <h1>Episode Guide</h1>
        <article>
	        <p>In the British Film Institute's year 2000 poll, <em>Fawlty Towers</em> was named as top of the 100 most important TV programmes of all time... voted as outright winner by actors, directors, producers, writers and critics...</p>
        </article>
        <article>
        	<h2>Series 1</h2>
        	<?php 
				if ($result = $mysqli->query("
											SELECT * 
											FROM Episode 
											WHERE seriesNo=1 
											ORDER BY episodeNo ASC")) { 
					while($obj = $result->fetch_object()){ 
						$id = $obj->id; 
						$title = $obj->title;
						$plotShort = $obj->plotShort;
						$plotLong = $obj->plotLong;
						$episodeNo = $obj->episodeNo;
			?>
        
        		<h3>
					<?php echo $episodeNo; ?> - <?php echo $title; ?>
                </h3>
                <p><?php echo $plotShort; ?></p>
        		<hr>
			<?php
                    } 
                }
            ?>
            </article>
            
            <article>
            <h2>Series 2</h2>
            <?php 
				if ($result = $mysqli->query("
											SELECT * 
											FROM Episode 
											WHERE seriesNo=2 
											ORDER BY episodeNo ASC")) { 
					while($obj = $result->fetch_object()){ 
						$id = $obj->id; 
						$title = $obj->title;
						$plotShort = $obj->plotShort;
						$plotLong = $obj->plotLong;
						$episodeNo = $obj->episodeNo;
			?>
        
        		<h3>
					<?php echo $episodeNo; ?> - <?php echo $title; ?>
                </h3>
                <p><?php echo $plotShort; ?></p>
        		<hr>
			<?php
                    } 
                }
            ?>
        </article>
    </section>
    </div>
    
    <?php
		include("components/rightBanners.php");
	?>
</div>
<?php
	include("components/footer.php");
?>
</body>
</html>
